﻿using System;
using System.Collections.Generic;
using System.Text;
using HAVNet.Core.String;


/*  A local type name may be "var", see C# 3.0 specification 8.5.1 Local
    variable declarations (implicitly typed local variable declaration)

TypeName
=												(. ntsym ("TypeName", depth); .)	(. ++depth; .)
    ident										(. tsym (t, depth); .)
    [
        "::"									(. tsym (t, depth); .)
        ident									(. tsym (t, depth); .)
    ]
    [ TypeArgumentList ]
    {
        "."										(. tsym (t, depth); .)
        ident									(. tsym (t, depth); .)
        [ TypeArgumentList ]
    }                                           (. lntsym(); --depth; .)
.                                                                               */

namespace HAVNet.Intros.AST
{
    public class ASTTypeNames : List<ASTTypeName>
    {
        public override string ToString ()
        {
            return Strings.joinobjs(", ", this);
        }
    }

    public class ASTTypeName : ASTNode
    {
        public readonly ASTTypeNameParts parts = new ASTTypeNameParts();

        public ASTTypeName (string s)
        {
            parts.Add (new ASTTypeNamePart(s, null));
        }

        public ASTTypeName ()
        {
            //
        }

        public override string ToString ()
        {
            return parts.ToString();
        }
    }
}
